<?php

namespace app\webapi\vms\model;

use think\Model;

/**
 * @定义网站模型
 */
class WebsiteModel extends Model
{
    //定义数据表名
    protected $table = 'jq_website';
    //开启自动时间戳
    protected $autoWriteTimestamp = true;

    /**
     * @desc 网站状态获取器
     * @param $value
     * @param $data
     * @return string
     * @author zhaozhiwei
     * @time 2023/12/19-14:27
     */
    public function getStatusTextAttr($value, $data)
    {
        $status = [0 => '未激活', 1 => '已启用', 2 => '已关闭'];
        return $status[$data['status']];
    }

    /**
     * @desc SSL证书状态获取器
     * @param $value
     * @param $data
     * @return string
     * @author zhaozhiwei
     * @time 2023/12/19-14:28
     */
    public function getSslStatusTextAttr($value, $data)
    {
        $status = [0 => '未开启', 1 => '已开启'];
        return $status[$data['ssl_status']];
    }
}